package org.example.physics_engine.collision;

import org.example.physics_engine.collision.manifold.Penetration;
import org.example.physics_engine.body.PhysicsBody;
import org.example.physics_engine.geometry.shapes.AbstractShape;

//碰撞过滤
public interface CollisionFilter {

     //物理引擎运行时通常分为Broad phase和Narrow phase这两个步骤。
     //Broad phase收集可能发生的潜在碰撞，
     //然后将之发送到Narrow phase，在这里进行真正的碰撞计算。
    //是否允许被Broad phase检测
    boolean isAllowedBroadPhase(PhysicsBody body1, PhysicsBody body2);

    //是否允许被Narrow phase计算
    boolean isAllowedNarrowPhase(PhysicsBody body1, PhysicsBody body2);

    //是否允许计算接触流形
    boolean isAllowedManifold(PhysicsBody body1, PhysicsBody body2, AbstractShape shape, Penetration penetration);


}
